<div class="col-12" >
    <div class="card">
        <div class="card-header">
            <h3 class="card-title">{{ .label }}</h3>
            <div class="card-tools">
                <div class="input-group input-group-sm" style="width: 250px;">
                    <input id="search-key" type="text" name="table_search" class="form-control float-right" placeholder="Search" value="{{ .key }}">
                    <div class="input-group-append">
                        <a type="submit" class="btn btn-default" id="search-a">
                            <i class="fa fa-search" style="color: grey"></i>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <!-- /.card-header -->
        <div class="card-body table-responsive p-0">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>用户</th>
                    <th>任务</th>
                    <th>ID</th>
                    <th>时间</th>
                    <th>状态</th>
                    <th>结果</th>
                </tr>
                </thead>
                <tbody id="uplog_table">
                {{ range  .data_list }}
                    <tr name="tbody">
                        <td>{{ .ID }}</td>
                        <td>{{ .UserName }}</td>
                        <td>
                            <div style="max-width:300px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;" name="up-connect">{{ .TaskName }}</div>
                        </td>

                        <td>{{ .TaskId }}</td>
                        <td>{{ date .CreatedAt "Y-m-d H:i:s" }}</td>
                        <td>
                            {{ if eq .Status "SUCCESS" }}
                                <span class="badge bg-success">{{ .Status }}</span>
                            {{ else }}
                                <span class="badge bg-danger">{{ .Status }}</span>
                            {{ end }}
                        </td>
                        <td style="padding-left:15px;">
                            <a href="javascript:;" name="check-task-log" task_id="{{ .ID }}" style="text-decoration:none;"><span class="fa fa-file-text fa-lg"></span></a>&nbsp;&nbsp;&nbsp;
                        </td>
                    </tr>
                {{ end }}
                </tbody>
            </table>

        </div>
        <!-- /.card-body -->
        <div class="card-footer clearfix">
            <ul class="pagination pull-right" style="margin-right: 50px">
                {{if eq $.page.CurPage 1 }}
                    <li class="page-item disabled"><a class="page-link" href="/log/task/1/">首页</a></li>
                    <li class="page-item disabled"><a class="page-link disabled" href="/log/task/{{ Sub $.page.CurPage 1 }}/">上一页</a></li>
                {{ else }}
                    <li class="page-item"><a class="page-link" href="/log/task/1/">首页</a></li>
                    <li class="page-item"><a class="page-link" href="/log/task/{{ Sub $.page.CurPage 1 }}/">上一页</a></li>
                {{ end }}
                </li>

                {{range $k,$v:=.page.Nums}}
                    <li class="page-item"><a class="page-link {{if eq $v $.page.CurPage}}active{{end}}" href="/log/task/{{$v}}/">{{ $v }}</a></li>
                    </li>
                {{end}}

                {{if eq $.page.CurPage .page.PageCount }}
                    <li class="page-item disabled"><a class="page-link" href="/log/task/{{ Add $.page.CurPage 1 }}/">下一页</a></li>
                    <li class="page-item disabled"><a class="page-link" href="/log/task/{{.page.PageCount }}/">尾页</a></li>
                {{ else }}
                    <li class="page-item"><a class="page-link" href="/log/task/{{ Add $.page.CurPage 1 }}/">下一页</a></li>
                    <li class="page-item"><a class="page-link" href="/log/task/{{.page.PageCount }}/">尾页</a></li>
                {{ end }}
            </ul>
        </div>
    </div>
    <!-- /.card -->
</div>


<div class="modal fade" id="taskModal" tabindex="-1" role="dialog" aria-labelledby="taskModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content" style="margin-top:130px;margin-left:-50%;min-width:1080px;">
            <div class="modal-header">
                <h4 class="modal-title" id="taskModalLabel">任务日志</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            </div>
            <div class="modal-body">
                    <pre id="task-log" style="background-color:black;color:green;font-size:16px;overflow:auto;max-height:550px;"></pre>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>